﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Function_Filehelp_Import.aspx.vb"
    Inherits="Map.Function_Filehelp_Import" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>导入帮助</title>
    <meta content="Microsoft Visual Studio .NET 7.0" name="GENERATOR">
    <meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    <link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
    <link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">

    <script language="javascript" src="/_common/scripts/global.js"></script>
	<script language="javascript" src="/_controls/util/util.js"></script>

    <script language="javascript">
        function chkForm() {
            if (Form1.fileImport.value == "") {
                alert("请选定需导入的文件！");
                return false;
            }
            var filename = Form1.fileImport.value.toUpperCase();
            if ((filename.lastIndexOf(".XLS") + 4) != filename.length) {
                alert("只能导入Excel(2003版本)文件！");
                return false;
            }
            return true;
        }

        function window.onload() {
            if (Form1.txtResult.value.toLowerCase() == "false") {
                alert("导入失败：" + Form1.txtMessage.value);
            }
            if (Form1.txtResult.value.toLowerCase() == "true") {
                window.opener.showFileHelp(Form1.hidApplication.value, Form1.hidFunctionCode.value);
                window.close();
            }
        }
    </script>

</head>
<body ms_positioning="GridLayout">
    <form id="Form1" method="post" runat="server" enctype="multipart/form-data">
    <asp:TextBox ID="txtResult" runat="server" Style="display: none"></asp:TextBox>
    <asp:TextBox ID="txtMessage" runat="server" Style="display: none"></asp:TextBox>
    <input type="hidden" id="hidApplication" runat="server" />
    <input type="hidden" id="hidFunctionCode" runat="server" />    
    <table height="100%" cellspacing="0" cellpadding="0" width="100%">
        <tr>
            <td class="main">
                <table height="100%" cellspacing="0" cellpadding="0" width="100%">
                    <colgroup>
                        <col width="60" />
                        <col />
                    </colgroup>
                    <tr>
                        <td class="req">
                            导入文件
                        </td>
                        <td>
                            <input id="fileImport" type="file" name="fileImport" runat="server" req="1" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <ul>
                                <li>导入文件必须为Excel(2003版本)文件</li>
                                <li>导入数据所在工作表名必须为<span style="color: red;">MyFileHelp</span></li>
                                <li>导入时如果存在相同文件路径将会覆盖原数据</li>
                            </ul>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr height="40">
            <td class="buttons">
                <asp:Button Text="导入" Width="70px" OnClientClick="return chkForm();" ID="btnImport"
                    runat="server" />&nbsp;&nbsp;
                <input type="button" value="取消" onclick="window.close();" style="width: 70px;" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
